const { sequelize } = require('../config/db');
const { DataTypes } = require('sequelize');

const remindersModels = sequelize.define('reminders', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  title: {
    type: DataTypes.STRING,
    allowNull: false
  },
  description: {
    type: DataTypes.TEXT,
    allowNull: false
  },
  time: {
    type: DataTypes.STRING,
    allowNull: false
  },
  type: {
    type: DataTypes.STRING,
    allowNull: false
  },
  type_text: {
    type: DataTypes.STRING,
    allowNull: false
  },
  type_icon: {
    type: DataTypes.STRING,
    allowNull: false
  },
  type_color: {
    type: DataTypes.STRING,
    allowNull: false
  },
  repeat_type: {
    type: DataTypes.STRING,
    allowNull: false
  },
  completed: {
    type: DataTypes.BOOLEAN,
    defaultValue: false
  },
  overdue: {
    type: DataTypes.BOOLEAN,
    defaultValue: false
  }
}, {
  tableName: 'reminders',
  timestamps: true
})

module.exports = { remindersModels };